<?php 
$uri = $this->uri->segment(1);
$acti = 'class="active"';

 ?>

<div class="giaitri_nav">
    <ul>
    <li><a href="<?php echo base_url() ?>" <?php if (trim($uri) === '') echo $acti ?>>Trang chủ</a></li>
<?php 
foreach ($nav as $row) {
    $url = url($row->alias);

 ?>
        <li><a href="<?php echo $url ?>" <?php if (trim($uri) == $row->alias) echo $acti ?> >
                <?php echo $row->title ?></a>
        </li>
<?php 
}
 ?>
    </ul>
</div>